package com.ak.server.log.entity;

import com.ak.common.utils.TimeConverter;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wuwenze.poi.annotation.Excel;
import com.wuwenze.poi.annotation.ExcelField;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Vean
 */
@Slf4j
@Data
@TableName("sys_login_log")
@Excel("登录日志")
public class LoginLog implements Serializable {

    private static final long serialVersionUID = 921991157363932095L;
    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 登录用户
     */
    @ExcelField("登录用户")
    private String username;

    /**
     * 登录时间
     */
    @ExcelField(value = "登录时间", writeConverter = TimeConverter.class)
    private Date loginTime;

    /**
     * 登录地点
     */
    @ExcelField(value = "登录地点")
    private String location;

    /**
     * 登录 IP
     */
    @ExcelField("登录IP")
    private String ip;

    /**
     * 浏览器请求头
     */
    private String ua;

    /**
     * 操作系统
     */
    @ExcelField("操作系统")
    private String system;

    /**
     * 登录浏览器
     */
    @ExcelField("登录浏览器")
    private String browser;

    /**
     * 浏览器版本
     */
    private String browserVersion;

    private transient String loginTimeFrom;
    private transient String loginTimeTo;
}
